<?php
echo $this->Html->script('tab/javascripts/vendor/modernizr.custom');
echo $this->Html->css('tab/stylesheets/style');
?>
<style>
    a.price-btn {
        display: block;
        background-color: #333333;
        color: #fff;
        padding: 4px;
        text-align: center;
        text-transform: uppercase;
        font-size: 14px;
        margin-top: 8px;
    }


</style>
<div class="row">
    <?php echo $this->element('search_form') ?>
    <div class="span9">
        <div class='tabs tabs_animate'>
            <ul class='horizontal'>
                <?php $c = 0; ?>
                <?php foreach ($dataAll as $f):; ?>                    
                    <li class="active"><a href="#tab-<?php echo $c ?>"><?php echo $f['title'] ?></a></li>
                    <?php $c++; ?>
                <?php endforeach; ?> 
            </ul>
            <?php $c = 0; ?>
            <?php foreach ($dataAll as $f): ?>
                <div id='tab-<?php echo $c ?>'>
                    <?php if (isset($f['data']) && sizeof($f['data']) != 0) { ?>
                        <?php $i = 0; ?>
                        <?php foreach ($f['data'] as $a): ?>                            
                            <div class="span3 <?php echo $i % 4 == 0 ? 'no-margin' : ''; ?>">
                                <div class="list-thumb">
                                    <div>
                                        <h5 class="no-padding">
                                            <?php echo $this->Html->link($a['ProjectDetail'][0]['title'], '/Projects/view/' . $a['Project']['id'], array('escape' => false, 'target' => '_blank')); ?>
                                        </h5>
                                    </div>
                                    <?php
                                    $im = $this->Html->image($a['Project']['default_pic'], array('height' => '130px', 'width' => 'auto'));
                                    echo $this->Html->link($im, '/Projects/view/' . $a['Project']['id'], array('escape' => false, 'target' => '_blank'));
                                    ?>
                                </div>
                                <div class="list-content" style="font-size: 13px;">
                                    <?php $lang = 'name_' . strtolower($a['ProjectDetail'][0]['language']); ?>
                                    <?php $adds = $a['Amphur'][$lang]; ?>
                                    <?php $price = $a['ProjectDetail'][0]['price']; ?>
                                    <?php echo $a['PropertyType'][$lang] . ', ' . $adds ?>
                                    <?php echo '<br/>[' . $price . ']' ?>
                                    <?php //echo $this->Html->link('View Property', '/Projects/view/' . $a['Project']['id'], array('class' => 'price-btn', 'target' => '_blank')) ?>
                                </div>
                            </div>
                            <?php $i++; ?>
                        <?php endforeach; ?> 
                    <?php }else { ?>
                        <h5 class="text-center c-red margin-top">Not found project.</h5>
                    <?php } ?>
                </div>
                <?php $c++; ?>
            <?php endforeach; ?> 
        </div>
    </div>
</div>
<?php
echo $this->Html->script('tab/javascripts/vendor/waypoints.min');
echo $this->Html->script('tab/javascripts/vendor/waypoints-sticky.min');
echo $this->Html->script('tab/javascripts/vendor/jquery.tabslet.min');
echo $this->Html->script('tab/javascripts/vendor/rainbow-custom.min');
echo $this->Html->script('tab/javascripts/initializers');
?>